// 定义一个类来表示学生信息
class Student {
    name: string;
    age: i32;
    studentId: string;
    mathGrade: f64;
    englishGrade: f64;
    scienceGrade: f64;

    constructor(name: string, age: i32, studentId: string, mathGrade: f64, englishGrade: f64, scienceGrade: f64) {
        this.name = name;
        this.age = age;
        this.studentId = studentId;
        this.mathGrade = mathGrade;
        this.englishGrade = englishGrade;
        this.scienceGrade = scienceGrade;
    }
}

// 函数5：无参数传入传出，for循环1加到1000赋值数组students，作为baseline
export function baselineTestStudents(): void {
    let students: Array<Student> = new Array<Student>(1000);
    for (let i = 0; i < 1000; i++) {
        students[i] = new Student(`Student${i}`, 20, `ID${i}`, 85.0, 90.0, 88.0);
    }
}

// 函数6：无参数传入，for循环1到1000赋值给数组students，传出数组students
export function noInputWithOutputStudents(): Array<Student> {
    let students: Array<Student> = new Array<Student>(1000);
    for (let i = 0; i < 1000; i++) {
        students[i] = new Student(`Student${i}`, 20, `ID${i}`, 85.0, 90.0, 88.0);
    }
    return students;
}

// 函数7：传入数组students1，for循环1到1000赋值给数组students2，这一步目的是控制变量，传出数组students2
export function withInputAndOutputStudents(students1: Array<Student>): Array<Student> {
    let students2: Array<Student> = new Array<Student>(1000);
    for (let i = 0; i < 1000; i++) {
        students2[i] = new Student(`Student${i}`, 20, `ID${i}`, 85.0, 90.0, 88.0);
    }
    return students2;
}

// 函数8：传入数组students1，for循环1到1000赋值给数组students2，这一步目的是控制变量，无返回值
export function withInputNoOutputStudents(students1: Array<Student>): void {
    let studentsjk = students1[0];
    let students2: Array<Student> = new Array<Student>(1000);
    for (let i = 0; i < 1000; i++) {
        students2[i] = new Student(`Student${i}`, 20, `ID${i}`, 85.0, 90.0, 88.0);
    }
}